﻿using System;
using System.Configuration;
using System.Data;
using System.Collections.Generic;

using System.Text;
using KPIS.DBM;
using KPIS.GERP.GFMS.MODEL;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_ICM_MAS_ResourceItem
    {
        DBManager dbManager = new DBManager(SystemInfo._DataProvider, SystemInfo._ConnectionString);

        public B_ICM_MAS_ResourceItem()
        {

        }

        public DataRow GetInfo(int seq)
        {
            string strSQL;
            DataRow dr = null;
            try
            {
                dbManager.Open();
                dbManager.CreateParameters(1);

                dbManager.AddParameters(0, "@seq", seq);

                strSQL = "SELECT icm_res_item_seq, icm_res_item_code"
                    + ", icm_res_item_old_code, icm_res_item_name, icm_res_item_descr"
                    + ", icm_res_sub_grp_seq, gpsc_code, giin_code, std_price, min_price"
                    + ", max_price, icm_unit_seq, min_qty, max_qty, image_name"
                    + " FROM icm_mas_resource_item"
                    + " WHERE icm_res_item_seq = @seq";

                dr = dbManager.ExecuteDataSet(CommandType.Text, strSQL).Tables[0].Rows[0];
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dbManager.Dispose();
            }

            return dr;
        }
    }
}